package com.jxc.action;

import java.io.IOException;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.jxc.entity.SessionEntity;
import com.jxc.dao.OpControlDAO;
import com.opensymphony.xwork2.ActionContext;

/**
 * @包名   com.jxc.system.role.web
 * @文件名 MenuControlAction.java
 * @作者   mopzyqing
 * @创建日期 Jul 15, 2010
 * @版本 V 1.0
 */
public class MenuControlAction {
	@Resource private OpControlDAO opControl;
	private List initList;
	public String InitMenu(){
		
		ActionContext ctx = ActionContext.getContext();
		HttpServletResponse response = (HttpServletResponse) ctx
				.get(ServletActionContext.HTTP_RESPONSE);
		HttpServletRequest request = (HttpServletRequest) ctx
				.get(ServletActionContext.HTTP_REQUEST);
		
		response.setHeader("Cache-Control", "no-cache");
		response.setContentType("text/json;charset=utf-8");
		
		int employeeID = ((SessionEntity)request.getSession().getAttribute("sessionEntity")).getEmployeeID();
		initList = opControl.initIndexPage(employeeID);
		
		return "success";
	}
	public List getInitList() {
		return initList;
	}
	public void setInitList(List initList) {
		this.initList = initList;
	}
}
